function request(url, params = {}, type = "get") {
    return new Promise(function(resolve, reject) {
        $.ajax({
            type: type,
            url: url,
            data: {...params },
            dataType: "json",
            success: function(data) {
                resolve(data);
            }
        })
    })

}

const register = params => request("../php/register.php", params, "post")
const isExistUser = params => request("../php/isExistUser.php", params)
const isExistPhone = params => request("../php/isExistPhone.php", params)
const isExistEmail = params => request("../php/isExistEmail.php", params)

const login = params => request("../php/login.php", params, "post")
const loginAccount = params => request("../php/login_account.php", params, "post");

const searchGradeOrderLimit = params => request("../php/searchGradeOrderLimit.php", params);
const deleteGradeById = params => request("../php/deleteGradeById.php", params);
const searchGradeById = params => request("../php/searchGradeById.php", params);
const updateGradeById = params => request("../php/updateGradeById.php", params);